package ooday03;

import java.util.Arrays;

public class RefArrayDemo {
    public static void main(String[] args) {
        Dog[] d=new Dog[3];
        d[0]=new Dog("狗1",1,"黑");
        d[1]=new Dog("狗2",2,"黄");
        d[2]=new Dog("狗3",3,"白");
        Chick[] c=new Chick[3];
        c[0]=new Chick("鸡1",2,"黄");
        c[1]=new Chick("鸡2",2,"黑");
        c[2]=new Chick("鲲鲲",18,"黑");
        Fish[] f=new Fish[3];
        f[0]=new Fish("我有鱼鱼枕",1,"白");
        f[1]=new Fish("我有玉玉箴",2,"褐");
        f[2]=new Fish("我有羽羽针",3,"白");
        for (int i = 0; i < 3; i++) {
            System.out.println(d[i]);
            System.out.println(c[i]);
            System.out.println(f[i]);
        }
        d[0].drink();
        d[1].eat();
        d[2].swim();
        c[0].layEggs();
        c[1].eat();
        c[2].drink();
        f[0].drink();
        f[1].eat();
        f[2].swim();
    }
}
